<HTML>

<HEAD><TITLE>Log Parser sample COM Input Format</TITLE></HEAD>

<BODY BGCOLOR="#EFEFFF" LINK="#000000" VLINK="#606060" ALINK="#303030">

<FONT SIZE="5"><B>XML COM Input Format sample</B></FONT><BR>

<P>
This sample COM input format implements a reader of sample XML files.
</P>

<P>
The following steps need to be performed in order to use this input format:

<OL>

<LI>Compile the <I>XMLInputFormat.cs</I> file with the following command: (substitute the .NET Framework system assemblies path with the path on your computer)<BR/> 
	<TT>csc.exe /r:C:\winnt\Microsoft.NET\Framework\v1.0.3705\System.dll /r:C:\winnt\Microsoft.NET\Framework\v1.0.3705\System.Xml.dll /target:library XMLInputFormat.cs AssemblyInfo.cs</TT>
</LI>

<P><BR/></P>

<LI>Install the <I>XMLInputFormat.dll</I> assembly into the <I>GAC</I> using the following command: <BR/>
	<TT>Gacutil.exe /i XMLInputFormat.dll</TT>
</LI>

<P><BR/></P>

<LI>Register the <I>XMLInputFormat.dll</I> assembly with the following command: <BR/> 
	<TT>Regasm.exe XMLInputFormat.dll</TT>
</LI>

<P><BR/></P>

<LI>To see the fields returned by this input format, execute the following Log Parser command: <BR/> 
	<TT>logparser -h -i:COM -iprogid:MSUtil.LogQuery.Sample.XMLInputFormat</TT> <BR/>

<P><BR/></P>

<LI>Execute the following Log Parser query to parse the <I>books.xml</I> file: <BR/> 
	<TT>logparser "SELECT * FROM books.xml" -i:COM -iprogid:MSUtil.LogQuery.Sample.XMLInputFormat</TT> <BR/>
	The query returns:<BR/>
	<FONT SIZE="3">
		<PRE>
Author Price     PubDate
------ --------- ------------------
Carson 31.950000 10/21/2001 0:00:00
Smith  52.400000 3/10/2003 0:00:00
Jones  53.970000 10/21/2001 0:00:00
Barney 32.400000 5/23/2000 0:00:00
Keller 98.820000 12/26/2001 0:00:00
Doe    77.250000 3/10/2003 0:00:00
Silver 10.990000 5/1/2001 0:00:00
		</PRE>
	</FONT>
</LI>

<P><BR/></P>

</OL>

</P>


</BODY>
</HTML>